﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using HRM.api;
using HRM.Models;
namespace HRM.Controllers
{
    public class VuController : Controller
    {
        //
        // GET: /Vu/

        public ActionResult Index()
        {
            return View();
        }
        public ActionResult GetVuDetails()
        {
            var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() };                        
            var vus = new VuAPIController().Get();
            var jsonResult = new ContentResult
            {
                Content = JsonConvert.SerializeObject(vus, settings),
                ContentType = "application/json"
            };

            return jsonResult;
        }

        public ActionResult GetAll()
        {
            var settings = new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() };
            var vus = new VuAPIController().Get();
            var jsonResult = new ContentResult
            {
                Content = JsonConvert.SerializeObject(vus, settings),
                ContentType = "application/json"
            };

            return jsonResult;
        }

    }
}
